package com.dmzc.stage3.AQS;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;

public class Test5 {
    public static void main(String[] args) {
        TestPark te = new TestPark();
        te.start();
    }
}

class TestPark extends Thread {


    private final boolean parkAndCheckInterrupt() {
        LockSupport.park(this);
        return Thread.interrupted();
    }

    @Override
    public void run() {
        try {
            TimeUnit.SECONDS.sleep(5);

            boolean boo = parkAndCheckInterrupt();
            System.out.println(boo);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
